/* ==================================================================== *
 *
 * This file is part of Mapics Framework.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @author Andrey Cherkashin <action.open@gmail.com>
 *
 * ==================================================================== */

/**
 * Construct specific event listener
 *
 * @param eventName (string) Mapics event name
 * @param listener  (object) Some pointer, that identifies listen handler
 * @param handler   (function) Handler function
 */
mapics.MapEventListener = function( eventName, listener, handler )
{
    this.m_EventName = eventName;
    this.m_Listener = listener;
    this.m_Handler = handler;
};

/**
 * Returns this event's name
 *
 * @return string
 */
mapics.MapEventListener.prototype.getEventName = function() {
    return this.m_EventName;
};

/**
 * Returns this event's listener (created by specific provider)
 *
 * @return object
 */
mapics.MapEventListener.prototype.getListener = function() {
    return this.m_Listener;
};

/**
 * Sets this event's listener (created by specific provider)
 *
 * @param listener (object)
 *
 * @return mapics.MapEventListener
 */
mapics.MapEventListener.prototype.setListener = function(listener) {
    this.m_Listener = listener;
    return this;
};

/**
 * Returns handler function of this event
 *
 * @return object (function)
 */
mapics.MapEventListener.prototype.getHandler = function() {
    return this.m_Handler;
};
